<script>
// 执行时间比beforeCreate还要早
// setup()函数中拿不到this
export default {
  setup() {
    console.log('这是setup函数');
    console.log(this)

    const message = "hello vue3"
    const logmessage = () => {
      console.log(message)
    }

    return {
      message,
      logmessage
    }
  },
  beforeCreate () {
    console.log('beforeCreate函数')
  }
}
</script>


<template>
    <div>执行vue3</div>
    <div>{{ message }}</div>
  </template>